#include "StdAfx.h"
#include "PendingState.h"
#include "network/Communicator.h"
#include "state/RunningState.h"

PendingState::PendingState()
{
    type = PENDING;
}

PendingState::~PendingState()
{

}

void PendingState::update(float dt)
{
	if (Game::getInstance()->game_type == Game::SINGLE) {
		/*if ( input->isKeyClicked(GLFW_KEY_SPACE) ) {*/
		throw std::runtime_error("no support for single player !");
	    //   queuedState = RUNNING;

		   //int id = 1;
		   //std::vector<int> dummyVec;
		   //Game::getInstance()->getRunningState()->initPlayers(id, dummyVec);
		   //Game::getInstance()->getCurrentState()->queuedState = State::RUNNING;
		/*}*/
	}
	else {
		Game::getInstance()->communicator->update(dt, type);
	}
}

void PendingState::handleInput()
{

}

void PendingState::activate()
{
    queuedState = NULL_STATE;
}

void PendingState::idle()
{
}